<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id')->comment("ID");
            $table->integer("class_id")->comment("类型ID");
            $table->string("class_name",50)->comment("类型名称");
            $table->string("goods_name",100)->comment("商品名称");
            $table->text("image")->comment("商品图片");
            $table->decimal("sell_price",10,2)->default(0)->comment("售价");
            $table->decimal("original_price",10,2)->default(0)->comment("原价");
            $table->integer("sales_volume")->default(0)->comment("销量");
            $table->text("detail")->nullable()->comment("商品详情");
            $table->integer("hot")->default(0)->comment("是否热门,值越大越热门");
            $table->integer("selected")->default(0)->comment("是否精选,值越大越精选");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
